﻿<?php
include("../common.inc.php");
InitGP(array("page","action","bid","delids")); //初始化变量全局返回
include("function_common.php");
//初始化对象
?>
<?php
	$file ="event.php";
	if($_GET['active'] == "save"){	
		$newcontent = stripslashes($_POST['newcontent']);
		$f = fopen($file, 'w');
		fwrite($f, $newcontent);
		//header("Location:success.php");
		echo "<script>location.href='success.php';</script>";
	}else{
		$f = fopen($file, 'r');
		$content = fread($f, filesize($file));
		$content = htmlspecialchars( $content );
	}

	fclose($f);
 ?>

<?php if($_GET['active']=="access"){ ?>
	<div style="border:soild 1px #333; background:#efefef; margin:10px 0; padding:7px;">更新完成!!</div>
<?php }?>
<form id="form1" name="form1" method="post" action="?active=save">
  <label>
  <textarea name="newcontent" style="width:100%; height:500px;"><?php echo $content; ?></textarea>
  <br>
  <input type="submit" name="button" id="button" value="儲存" />
  </label>
</form>
